fix: adjust height calculation order in BluetoothApplet#338
Conversation
1. Reordered the height calculation logic to prioritize maximum height check before minimum height check 2. This prevents potential layout issues when content height exceeds maximum allowed height 3. Maintains the same functionality but with more logical calculation flow 4. The change ensures consistent behavior when dealing with edge cases fix: 调整蓝牙小程序高度计算顺序 1. 重新排序高度计算逻辑,优先检查最大高度限制再检查最小高度限制 2. 防止当内容高度超过允许最大值时可能出现的布局问题 3. 保持相同功能但采用更合理的计算流程 4. 此变更确保处理边界情况时行为一致 Pms: BUG-320239
Reviewer's GuideThe PR refactors BluetoothApplet::updateSize by reordering the height clamp logic to apply the maximum height limit before enforcing the minimum height, ensuring consistent layout behavior when content height exceeds bounds. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review代码审查意见:
总体来说,代码的修改看起来是合理的,没有引入新的问题,但是可以进一步优化以提高代码质量和可维护性。 |
There was a problem hiding this comment.
Hey @wjyrich - I've reviewed your changes - here's some feedback:
- Consider replacing the two-step qMin / qMax logic with a single clamp (e.g. qBound) for clearer intent and fewer lines.
- Add an assertion or guard to ensure m_minHeight (after subtracting margins) never exceeds maxHeight to avoid invalid layout states.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider replacing the two-step qMin / qMax logic with a single clamp (e.g. qBound) for clearer intent and fewer lines.
- Add an assertion or guard to ensure m_minHeight (after subtracting margins) never exceeds maxHeight to avoid invalid layout states.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: behind) |
fix: 调整蓝牙小程序高度计算顺序
Pms: BUG-320239
Summary by Sourcery
Bug Fixes: